import React from 'react';
import useCounter from '../../hooks/useCount';
 
const Count = (prop) => {
  const { count, increment, decrement, reset } = useCounter(prop.count);
  // console.log(prop.count)
  return (
    <>
      <p>Count: {count}</p>
      <button onClick={increment}>递增</button>
      <button onClick={decrement}>递减</button>
      <button onClick={reset}>重置</button>
    </>
  );
};
 
export default Count;